<template>
  <div class="header">
    <div class="hometitle" @click="navTo('/cityList')">
      <span class>全球</span>
      <i class="ico-arrow"></i>
    </div>
    <div class="searchline" @click="navTo('/searchPage')">
      <i class="ico-search"></i>
      <span>目的地/景点/话题...</span>
    </div>
    <div class="message" @click="navTo('/messagePage')">
      <img width="33" src="../assets/message.png" alt />
    </div>
  </div>
</template>

<script>
export default {
  name: 'UniHeader',
  props: {},
  methods: {
    navTo(path) {
      this.$router.push(path);
    }
  }
}
</script>

<style scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
}

.hometitle {
  color: rgb(51, 51, 51);
  font-size: 16px;
  font-weight: bold;
  display: flex;
  /* justify-content: center; */
  align-items: center;
  flex-shrink: 0;
}

.ico-arrow {
  width: 16px;
  height: 16px;
  overflow: hidden;
  display: inline-block;
  background: url("../assets/lvpai_home_switcharr_v1.png") no-repeat 50%;
  background-size: 16px;
  vertical-align: -2px;
  margin-left: 4px;
  margin-right: 16px;
}

.searchline {
  height: 32px;
  border-radius: 32px;
  line-height: 32px;
  background: #f4f4f4;
  box-shadow: none;
  padding: 0 6px;
  color: #999;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
  flex-grow: 1;
  margin: 0 12px;
  text-align: left;
}

.ico-search {
  display: inline-block;
  width: 12px;
  height: 12px;
  overflow: hidden;
  background: url("../assets/tripshoot_search@3x.png") no-repeat 50%;
  background-size: 12px;
  margin: 0 8px 0 6px;
  vertical-align: -1px;
}

.message {
  width: 33px;
  height: 33px;
}
</style>
